/// @tags: DP with Matrix
#include <cstdio>
#include <cstring>
#include <iostream>

using namespace std;

namespace BlueQuantum {

typedef long long LL;

int constexpr P = 1e9 + 7;

struct Matrix {
  int a[3][3];

  Matrix(int val = 0) {
    memset(a, 0, sizeof(a));
    for (int i = 0; i < 3; ++i) a[i][i] = val;
  }

  inline int* operator[](int index) { return a[index]; }
  inline int const* operator[](int index) const { return a[index]; }

  inline Matrix operator*(Matrix const& rhs) const {
    Matrix c(0);
    for (int i = 0; i < 3; ++i)
      for (int k = 0; k < 3; ++k)
        for (int j = 0; j < 3; ++j) c[i][j] = (c[i][j] + (LL)a[i][k] * rhs[k][j]) % P;
    return c;
  }

  inline Matrix operator^(int exp) const {
    Matrix res(1), base(*this);
    for (; exp; exp >>= 1, base = base * base)
      if (exp & 1) res = res * base;
    return res;
  }
} A, B, Ans(1);

inline int main() {
  A[0][0] = 2, A[0][1] = 1, A[0][2] = 1;
  A[1][0] = 2, A[1][1] = 1, A[1][2] = 0;
  A[2][0] = 1, A[2][1] = 1, A[2][2] = 1;
  B[0][0] = 1, B[0][1] = 0, B[0][2] = 0;
  B[1][0] = 2, B[1][1] = 1, B[1][2] = 0;
  B[2][0] = 1, B[2][1] = 1, B[2][2] = 1;
  int n, m;
  cin >> n >> m;
  int lst = 0;
  for (int i = 1, x; i <= m; ++i) {
    cin >> x;
    Ans = (A ^ (x - lst - 1)) * Ans;
    Ans = B * Ans;
    lst = x;
  }
  Ans = (A ^ (n - lst - 1)) * Ans;
  Ans = B * Ans;
  cout << Ans[2][0];
  return 0;
}

}  // namespace BlueQuantum

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("/tmp/CodeTmp/testdata.in", "r", stdin);
  freopen("/tmp/CodeTmp/testdata.out", "w", stdout);
#else
  freopen("AT2371 [AGC013E] Placing Squares.in", "r", stdin);
  freopen("AT2371 [AGC013E] Placing Squares.out", "w", stdout);
#endif
#endif

  ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  return BlueQuantum::main();
}
